<template>
  <el-container class="bg-white rounded" :style="{height:h+'px'}">
    <el-header class="image-header" >
      <el-button type="primary" size="small" @click="handleOpen">新增图片分类</el-button>
      <el-button type="warning" size="small" @click="handleOpenUpload">新增图片</el-button>
      
    </el-header>
     <el-container>
        <ImageAside ref="aside" @change="handleClassId"/>
        
 
        <ImageMain ref="ImageMainRef"/>

    </el-container>
  </el-container>
</template>
<script setup>
import { ref } from 'vue'
import ImageAside from '@/components/imageAside.vue'
import ImageMain from '@/components/imageMain.vue'
const windowHeight=window.innerHeight || document.body.clientHeight
const h=windowHeight-64-44-40

const aside=ref(null)
const   handleOpen=()=> aside.value.handleCreate()
const ImageMainRef =ref(null)


const handleClassId = (image_class_id)=>ImageMainRef.value.loadData(image_class_id)
const handleOpenUpload=()=> {
  ImageMainRef.value.upload()
}
</script>
<style lang="scss" scoped>
.image-header{
    border-bottom:1px solid #eeeeee;
    @apply flex items-center;
}

</style>